package com.artisan.spider.service.impl;

import com.artisan.spider.domain.SpScheduled;
import com.artisan.spider.mapper.SpScheduledMapper;
import com.artisan.spider.service.ISpScheduledService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * </p>
 *
 * @author kubilewang
 * @since 2022-03-26
 */
@Service
public class SpScheduledServiceImpl extends ServiceImpl<SpScheduledMapper, SpScheduled> implements ISpScheduledService {

    @Override
    public boolean updateRunningStatusToWaitStartFlag() {

        SpScheduled condition = new SpScheduled();
        condition.setStartFlag(0);
        QueryWrapper<SpScheduled> queryWrapper = new QueryWrapper<>();
        return update(condition, queryWrapper.eq("start_flag",1));
    }
}
